package org.demo.pattern.prototype;
/**
 * 原型模式
 * 通过复制原型实例来创建新的对象
 * @author  
 * @date    2011-5-20
 * @file    org.demo.pattern.prototype.PrototypeTest.java
 */
public class PrototypeTest {

	public static void main(String[] args) throws Exception {
		
		Person p = new Person("A", Person.SEX.MALE);
		Person p2 = (Person)p.clone();
		
		p2.setName("B");
		
		System.out.println(p);
		System.out.println(p2);
	}
}
